package com.qlk.test.vorder.rest;

import org.junit.Test;
import org.springframework.util.Assert;

import com.qlk.common.client.AbstractClient;
import com.qlk.test.vorder.rest.dto.Task;
import com.qlk.test.vorder.rest.request.TaskRequest;
import com.qlk.test.vorder.rest.response.TaskResponse;
import com.qlk.test.vorder.rest.Urls;

/**
 * TaskResource单元测试
 * 
 * @author zhaoyanan
 * @version 2016-7-28 14:14:01
 * 
 */
public class TaskResourceTestCase extends AbstractClient {

	@Test
	public void testGetTask() {
		String url = Urls.API_DOMAIN + "/task/getTask";

		TaskRequest request = new TaskRequest();
		request.setTaskId(1l);
		TaskResponse response = super.getRestTemplate().postForObject(url, request, TaskResponse.class);
		Assert.notNull(response);
		Task task = super.getResult(response);
		Assert.notNull(task);
	}
}
